/*************************************************************************
  Crytek Source File.
  Copyright (C), Crytek Studios, 2001-2010.
 -------------------------------------------------------------------------
  $Id$
  $DateTime$
  
 -------------------------------------------------------------------------
  History:
  - Oct 5th, 2010  : Created by Michelle Martin
 *************************************************************************/

#include "StdAfx.h"
#include "IKTarget_EntityPos.h"
#include <IEntitySystem.h>  // for GetEntity() by id




CIKTarget_EntityPos::CIKTarget_EntityPos(const SIKTargetParams& ikParams, QuatT &startPosition, EntityId targetEntityID) : CIKTarget_Base(ikParams, startPosition)
{
	m_targetEntity = gEnv->pEntitySystem->GetEntity(targetEntityID);
	if (!m_targetEntity)
		CryWarning(VALIDATOR_MODULE_GAME, VALIDATOR_ERROR, "IK Target: Invalid target Entity ID, this will cause the IK to crash when used with this target");
}

QuatT CIKTarget_EntityPos::UpdateWorldPos( float frameTime )
{
	CRY_ASSERT_MESSAGE(m_targetEntity, "Target Entity invalid, this will cause a crash.");
	return QuatT(m_targetEntity->GetWorldTM());
}